
#pragma once

#include "ly/box.hpp"
#include "ly/types.hpp"
#include "ly/vec2.hpp"

namespace ly {

template <class C>
class path {
 public:
  typedef C coord_t;
  typedef std::vector<ly::point<C>> points_t;
  typedef ly::box<C> box_t;

  path(const std::vector<point<C>>& pts) : m_points(pts) {}
  path() = default;

  void width(coord_t v) { m_width = v; };
  coord_t width() { return m_width; };

  void begin_ext(coord_t v) { m_begin_ext = v; };
  coord_t begin_ext() { return m_begin_ext; };

  void end_ext(coord_t v) { m_end_ext = v; };
  coord_t end_ext() { return m_end_ext; };

  box_t bbox() {
    update_bbox();
    return m_bbox;
  };

 private:
  box_t update_bbox() {};

  coord_t m_width;
  coord_t m_begin_ext{0}, m_end_ext{0};
  points_t m_points;
  box_t m_bbox;
};

typedef path<Coord> Path;
typedef std::vector<path<Coord>> Paths;
typedef path<DCoord> DPath;
typedef std::vector<path<DCoord>> DPaths;

}  // namespace ly
